local scene = director:createScene()

function scene:setUp(event)
    dbg.print("sceneInstructions:setUp")

	local newScale = 320/director.displayWidth
	local newScaleY = 480/director.displayHeight
	
	local box = director:createRectangle( {x=40/newScale, y=50/newScaleY, w=240/newScale, h=380/newScaleY, color=color.red} )
	local labelInstructionsOne = director:createLabel({x=160/newScale, y=390/newScaleY, hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsTwo = director:createLabel({x=160/newScale, y=360/newScaleY, hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsThree = director:createLabel({x=160/newScale, y=330/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsFour = director:createLabel({x=160/newScale, y=300/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsFive = director:createLabel({x=160/newScale, y=270/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsSix = director:createLabel({x=160/newScale, y=240/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsSeven = director:createLabel({x=160/newScale, y=210/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsEight = director:createLabel({x=160/newScale, y=180/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsNine = director:createLabel({x=160/newScale, y=150/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsTen = director:createLabel({x=160/newScale, y=120/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsEleven = director:createLabel({x=160/newScale, y=90/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
	local labelInstructionsTwelve = director:createLabel({x=160/newScale, y=60/newScaleY,hAlignment="center", xAnchor=0.5, xScale=1/newScale, yScale=1/newScaleY,})
		
	labelInstructionsOne.text="Its goal is to"
	labelInstructionsTwo.text="bring 3 people"
	labelInstructionsThree.text="on the other side"
	labelInstructionsFour.text="of the avenue in"
	labelInstructionsFive.text="the shortest time"
	labelInstructionsSix.text=""
	labelInstructionsSeven.text="JUMP mode should"
	labelInstructionsEight.text="pass over the"
	labelInstructionsNine.text="trucks"
	labelInstructionsTen.text=""
	labelInstructionsEleven.text="EVADE mode must"
	labelInstructionsTwelve.text="dodge trucks"
		
	local buttonBack = director:createSprite(250/newScale, 50/newScaleY, "img/buttonBack.png")
	buttonBack.xAnchor=0.5; buttonBack.yAnchor=0.5
	buttonBack.xScale=.5/newScale; buttonBack.yScale=.5/newScaleY
	buttonBack.y = buttonBack.y - buttonBack.h/2
	
	function buttonBack:touch(event)
		if (event.phase == 'began') then
			system:sendEvent("moveToSceneMenu")
		end
	end
	buttonBack:addEventListener('touch', buttonBack)
end

function scene:tearDown(event)
    dbg.print("sceneInstructions:tearDown")
end

scene:addEventListener({"setUp", "tearDown"}, scene)

return scene -- We must return the scene object!